package com.seveneight.baijiesteward.ui.user.fragment;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.seveneight.baijiesteward.R;
import com.seveneight.baijiesteward.base.BaseFragmentBack;
import com.seveneight.baijiesteward.ui.main.activity.ForgetPwdActivity;
import com.seveneight.baijiesteward.utils.WindowUtil;

/**
 * Created by user1 on 2018/2/11.
 */

public class ManagerAccountFragment extends BaseFragmentBack implements View.OnClickListener {

    private ImageView iv_back;
    private TextView tv_title;
    private RelativeLayout layout_changedealpwd;
    private RelativeLayout layout_changeloginpwd;
    private static int TYPE_CHANGEDEALPWD = 1;
    private static int TYPE_CHANGELOGINPWD = 2;


    @Override
    protected int getContentView() {
        return R.layout.fragment_manager;
    }

    public static ManagerAccountFragment newInstance() {
        Bundle args = new Bundle();
        ManagerAccountFragment fragment = new ManagerAccountFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    protected void initView() {
        iv_back = findView(R.id.iv_back);
        tv_title = findView(R.id.tv_title);
        layout_changedealpwd = findView(R.id.layout_changedealpwd);
        layout_changeloginpwd = findView(R.id.layout_changeloginpwd);
        tv_title.setText("账户管理");
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void setListener() {
        iv_back.setOnClickListener(this);
        layout_changedealpwd.setOnClickListener(this);
        layout_changeloginpwd.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.iv_back:
                _mActivity.onBackPressed();
                break;
            case R.id.layout_changedealpwd:
                Bundle bundle = new Bundle();
                bundle.putInt("type", TYPE_CHANGEDEALPWD);
                WindowUtil.getInstance().startActivity(mContext, ForgetPwdActivity.class, bundle);
                break;
            case R.id.layout_changeloginpwd:
                Bundle bundle2 = new Bundle();
                bundle2.putInt("type", TYPE_CHANGELOGINPWD);
                WindowUtil.getInstance().startActivity(mContext, ForgetPwdActivity.class, bundle2);
                break;
        }
    }
}
